﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleFactory
{
    class Program
    {
        static void Main(string[] args)
        {
        }
    }
    public class SimplePizzaFactory
    {
        public Pizza CreatePizza(string orderType)
        {
            Pizza pizza = null;
            switch (orderType)
            {
                case "Cheese":
                    pizza = new CheesePizza();
                    break;
                case "Greek":
                    pizza = new CheesePizza();
                    break;
                case "Pepper":
                    pizza = new CheesePizza();
                    break;
                default:
                    break;
            }
            return pizza;
        }
    }

    public abstract class Pizza
    {
        public abstract void ShowName();
    }
    public class CheesePizza : Pizza
    {
        public override void ShowName()
        {
            Console.WriteLine("CheesePizza");
        }
    }
    public class GreekPizza : Pizza
    {
        public override void ShowName()
        {
            Console.WriteLine("GreekPizza");
        }
    }
    public class PepperPizza : Pizza
    {
        public override void ShowName()
        {
            Console.WriteLine("PepperPizza");
        }
    }
}
